import { Column, Entity, Index } from 'typeorm';
import { BaseEntity } from '../common/entities/base.entity';

@Entity()
export class User extends BaseEntity {
  @Column({ length: 12 })
  @Index('UQ_ACCOUNT', { unique: true })
  account: string;

  @Column({ length: 100 })
  password: string;

  @Column({ length: 20, nullable: true })
  @Index('UQ_NAME', { unique: true })
  name: string;

  @Column({ nullable: true })
  sex: 0 | 1 | null;

  @Column({ nullable: true })
  age: number;
}
